package Java.BlackHorse.a01CollectionsTest;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,1,1,1,1,1,1,1);
        Collections.addAll(list,0,0, 0);

        Random r = new Random();
        int index =r.nextInt(list.size());
        int num=list.get(index);

        ArrayList<String> onelist = new ArrayList<>();
        ArrayList<String> twolist = new ArrayList<>();

        Collections.addAll(onelist,"李白","镜","马超","刘备","赔钱虎","百里玄策");
        Collections.addAll(twolist,"孙尚香","后羿","鲁班七号","李元芳","黄忠","百里守约");

        if(num==0){
            System.out.print("射手：");
            int twoindex = r.nextInt(twolist.size());
            String name = twolist.get(twoindex);
            System.out.println(name);
        }else{
            System.out.print("打野：");
           int oneindex = r.nextInt(onelist.size());
           String name = onelist.get(oneindex);
            System.out.println(name);
        }
    }
}
